<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>16在Vue中如何使用插槽(slot)</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <child>
            <!-- <div class="header" slot="header">header</div> -->
            <div class="footer" slot="footer">footer</div>
        </child>
    </div>
    <script>
        Vue.component('child', {
            template: `<div>
                <slot name="header">default header...</slot>
                <div class="content">content</div>
                <slot name="footer"></slot>
                </div>`
        })
        var vm = new Vue({
            el: '#app'
        })
    </script>
</body>

</html>